<?php

namespace App\Http\Requests\Api;

class MenuRequest extends FormRequest
{
    public function rules()
    {

        return [

            'name' => 'required|unique:menu,name',
            'type' => 'required',
            'path' => 'required',
            'sort' => 'required',
            //'component' => 'required',
        ];
    }

    public function messages()
    {
        return [

            'name.required'=>'路由名称不能为空',
            'name.unique' => '菜单名称名已经存在',
            'type.required' => '菜单类型不能为空',
            'path.required' => '路径不能为空',
            'sort.required' => '排序不能为空',
           // 'component.required' => '组件不能为空',

        ];
    }
}
